/*
 * @description: 
 * @Author: wzg
 * @Date: 2021-03-08 08:42:12
 * @LastEditTime: 2021-03-18 16:52:01
 */
const resultEnum = require('../utils/resultEnum').ResultEnum;
const Mock = new(require('../utils/mock')).Mocks();

/* 查询收藏信息 */
async function selectCollectInfo(ctx, next) {
  try {
    const params = {
      ...ctx.query
    };
    console.log(params);

    ctx.success(resultEnum.GET_SUCCESS.code, resultEnum.GET_SUCCESS.msg, {})

  } catch (error) {
    ctx.error(resultEnum.GET_ERROR.code, resultEnum.GET_ERROR.msg)
  }
}
/* 查询竞拍记录信息 */
function selectAuctionRecordInfo(ctx, next) {
  try {
    const params = {
      ...ctx.query
    };
    console.log(params);
    /* 模拟查询数据库，处理后返回 */
    /* 返回对象 */
    if (Number(params.current) >= 3) {
      ctx.success(resultEnum.GET_SUCCESS.code, resultEnum.GET_SUCCESS.msg, Mock.getBlankInfo())
    } else {
      ctx.success(resultEnum.GET_SUCCESS.code, resultEnum.GET_SUCCESS.msg, Mock.getAuctionRecordList())
    }
  } catch (error) {
    ctx.error(resultEnum.GET_ERROR.code, resultEnum.GET_ERROR.msg)
  }
}
module.exports = {
  selectCollectInfo,
  selectAuctionRecordInfo
}